 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

JDCLOUD流计算API
提供流计算操作的相关接口。

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKStreamcomputer/StreamcomputerExecutor.h>

@implementation StreamcomputerClient

@synthesize userAgent = _userAgent;
@synthesize serviceName = _serviceName;
@synthesize version = _version;

-(void) addCustomerHeaderWithKey:(NSString*) key
                           value:(NSString*) value{
    if(![self customHeader])
    {
        self.customHeader = [[NSMutableDictionary alloc] init];
    }
    if(key && value)
    {
        [[self customHeader] setValue:value forKey:key];
    }
   
}

-(id)initWithGlobalConfig{
    if(![GlobalConfig credential])
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@"GlobalConfig credential not config" userInfo:nil];
        @throw e;
    }
    self.credential = [GlobalConfig credential];
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"streamcompute.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 streamcomputer  v1";
    _serviceName = @"streamcomputer";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
         sdkEnvironment:(SDKEnvironment*)sdkEnvironment
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    
    if(!sdkEnvironment)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" sdkEnvironment can not null" userInfo:nil];
        @throw e;
    }else{
        self.sdkEnvironment = sdkEnvironment;
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 streamcomputer  v1";
    _serviceName = @"streamcomputer";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"streamcompute.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 streamcomputer  v1";
    _serviceName = @"streamcomputer";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)init{
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 streamcomputer  v1";
    _serviceName = @"streamcomputer";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}


/**
queryNamespaceDetail sync request
@param queryNamespaceDetailRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `queryNamespaceDetailResponse` the request response data model
*/
-(NSDictionary*) queryNamespaceDetailSyncWithRequest:(StreamcomputerQueryNamespaceDetailRequest*) queryNamespaceDetailRequest
{
StreamcomputerQueryNamespaceDetailExecutor* excutor = [[StreamcomputerQueryNamespaceDetailExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:queryNamespaceDetailRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerQueryNamespaceDetailResponse* response = [[StreamcomputerQueryNamespaceDetailResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"queryNamespaceDetailResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)queryNamespaceDetailAsyncWithRequest:(StreamcomputerQueryNamespaceDetailRequest*) queryNamespaceDetailRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerQueryNamespaceDetailResponse* _Nullable queryNamespaceDetailResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerQueryNamespaceDetailExecutor* excutor = [[StreamcomputerQueryNamespaceDetailExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:queryNamespaceDetailRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerQueryNamespaceDetailResponse* response = [[StreamcomputerQueryNamespaceDetailResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeJob sync request
@param describeJobRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeJobResponse` the request response data model
*/
-(NSDictionary*) describeJobSyncWithRequest:(StreamcomputerDescribeJobRequest*) describeJobRequest
{
StreamcomputerDescribeJobExecutor* excutor = [[StreamcomputerDescribeJobExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeJobRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerDescribeJobResponse* response = [[StreamcomputerDescribeJobResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeJobResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeJobAsyncWithRequest:(StreamcomputerDescribeJobRequest*) describeJobRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerDescribeJobResponse* _Nullable describeJobResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerDescribeJobExecutor* excutor = [[StreamcomputerDescribeJobExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeJobRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerDescribeJobResponse* response = [[StreamcomputerDescribeJobResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeStorage sync request
@param describeStorageRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeStorageResponse` the request response data model
*/
-(NSDictionary*) describeStorageSyncWithRequest:(StreamcomputerDescribeStorageRequest*) describeStorageRequest
{
StreamcomputerDescribeStorageExecutor* excutor = [[StreamcomputerDescribeStorageExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeStorageRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerDescribeStorageResponse* response = [[StreamcomputerDescribeStorageResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeStorageResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeStorageAsyncWithRequest:(StreamcomputerDescribeStorageRequest*) describeStorageRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerDescribeStorageResponse* _Nullable describeStorageResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerDescribeStorageExecutor* excutor = [[StreamcomputerDescribeStorageExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeStorageRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerDescribeStorageResponse* response = [[StreamcomputerDescribeStorageResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteJob sync request
@param deleteJobRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteJobResponse` the request response data model
*/
-(NSDictionary*) deleteJobSyncWithRequest:(StreamcomputerDeleteJobRequest*) deleteJobRequest
{
StreamcomputerDeleteJobExecutor* excutor = [[StreamcomputerDeleteJobExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteJobRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerDeleteJobResponse* response = [[StreamcomputerDeleteJobResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteJobResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteJobAsyncWithRequest:(StreamcomputerDeleteJobRequest*) deleteJobRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerDeleteJobResponse* _Nullable deleteJobResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerDeleteJobExecutor* excutor = [[StreamcomputerDeleteJobExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteJobRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerDeleteJobResponse* response = [[StreamcomputerDeleteJobResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
addOrUpdateJob sync request
@param addOrUpdateJobRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `addOrUpdateJobResponse` the request response data model
*/
-(NSDictionary*) addOrUpdateJobSyncWithRequest:(StreamcomputerAddOrUpdateJobRequest*) addOrUpdateJobRequest
{
StreamcomputerAddOrUpdateJobExecutor* excutor = [[StreamcomputerAddOrUpdateJobExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:addOrUpdateJobRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerAddOrUpdateJobResponse* response = [[StreamcomputerAddOrUpdateJobResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"addOrUpdateJobResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)addOrUpdateJobAsyncWithRequest:(StreamcomputerAddOrUpdateJobRequest*) addOrUpdateJobRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerAddOrUpdateJobResponse* _Nullable addOrUpdateJobResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerAddOrUpdateJobExecutor* excutor = [[StreamcomputerAddOrUpdateJobExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:addOrUpdateJobRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerAddOrUpdateJobResponse* response = [[StreamcomputerAddOrUpdateJobResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
queryNamespaces sync request
@param queryNamespacesRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `queryNamespacesResponse` the request response data model
*/
-(NSDictionary*) queryNamespacesSyncWithRequest:(StreamcomputerQueryNamespacesRequest*) queryNamespacesRequest
{
StreamcomputerQueryNamespacesExecutor* excutor = [[StreamcomputerQueryNamespacesExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:queryNamespacesRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerQueryNamespacesResponse* response = [[StreamcomputerQueryNamespacesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"queryNamespacesResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)queryNamespacesAsyncWithRequest:(StreamcomputerQueryNamespacesRequest*) queryNamespacesRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerQueryNamespacesResponse* _Nullable queryNamespacesResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerQueryNamespacesExecutor* excutor = [[StreamcomputerQueryNamespacesExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:queryNamespacesRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerQueryNamespacesResponse* response = [[StreamcomputerQueryNamespacesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
startJob sync request
@param startJobRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `startJobResponse` the request response data model
*/
-(NSDictionary*) startJobSyncWithRequest:(StreamcomputerStartJobRequest*) startJobRequest
{
StreamcomputerStartJobExecutor* excutor = [[StreamcomputerStartJobExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:startJobRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerStartJobResponse* response = [[StreamcomputerStartJobResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"startJobResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)startJobAsyncWithRequest:(StreamcomputerStartJobRequest*) startJobRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerStartJobResponse* _Nullable startJobResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerStartJobExecutor* excutor = [[StreamcomputerStartJobExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:startJobRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerStartJobResponse* response = [[StreamcomputerStartJobResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
addOrUpdateStorage sync request
@param addOrUpdateStorageRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `addOrUpdateStorageResponse` the request response data model
*/
-(NSDictionary*) addOrUpdateStorageSyncWithRequest:(StreamcomputerAddOrUpdateStorageRequest*) addOrUpdateStorageRequest
{
StreamcomputerAddOrUpdateStorageExecutor* excutor = [[StreamcomputerAddOrUpdateStorageExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:addOrUpdateStorageRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerAddOrUpdateStorageResponse* response = [[StreamcomputerAddOrUpdateStorageResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"addOrUpdateStorageResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)addOrUpdateStorageAsyncWithRequest:(StreamcomputerAddOrUpdateStorageRequest*) addOrUpdateStorageRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerAddOrUpdateStorageResponse* _Nullable addOrUpdateStorageResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerAddOrUpdateStorageExecutor* excutor = [[StreamcomputerAddOrUpdateStorageExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:addOrUpdateStorageRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerAddOrUpdateStorageResponse* response = [[StreamcomputerAddOrUpdateStorageResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
getJobList sync request
@param getJobListRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getJobListResponse` the request response data model
*/
-(NSDictionary*) getJobListSyncWithRequest:(StreamcomputerGetJobListRequest*) getJobListRequest
{
StreamcomputerGetJobListExecutor* excutor = [[StreamcomputerGetJobListExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getJobListRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerGetJobListResponse* response = [[StreamcomputerGetJobListResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getJobListResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getJobListAsyncWithRequest:(StreamcomputerGetJobListRequest*) getJobListRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerGetJobListResponse* _Nullable getJobListResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerGetJobListExecutor* excutor = [[StreamcomputerGetJobListExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getJobListRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerGetJobListResponse* response = [[StreamcomputerGetJobListResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteNamespace sync request
@param deleteNamespaceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteNamespaceResponse` the request response data model
*/
-(NSDictionary*) deleteNamespaceSyncWithRequest:(StreamcomputerDeleteNamespaceRequest*) deleteNamespaceRequest
{
StreamcomputerDeleteNamespaceExecutor* excutor = [[StreamcomputerDeleteNamespaceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteNamespaceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerDeleteNamespaceResponse* response = [[StreamcomputerDeleteNamespaceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteNamespaceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteNamespaceAsyncWithRequest:(StreamcomputerDeleteNamespaceRequest*) deleteNamespaceRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerDeleteNamespaceResponse* _Nullable deleteNamespaceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerDeleteNamespaceExecutor* excutor = [[StreamcomputerDeleteNamespaceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteNamespaceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerDeleteNamespaceResponse* response = [[StreamcomputerDeleteNamespaceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
stopJob sync request
@param stopJobRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `stopJobResponse` the request response data model
*/
-(NSDictionary*) stopJobSyncWithRequest:(StreamcomputerStopJobRequest*) stopJobRequest
{
StreamcomputerStopJobExecutor* excutor = [[StreamcomputerStopJobExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:stopJobRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerStopJobResponse* response = [[StreamcomputerStopJobResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"stopJobResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)stopJobAsyncWithRequest:(StreamcomputerStopJobRequest*) stopJobRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerStopJobResponse* _Nullable stopJobResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerStopJobExecutor* excutor = [[StreamcomputerStopJobExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:stopJobRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerStopJobResponse* response = [[StreamcomputerStopJobResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createNamespace sync request
@param createNamespaceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createNamespaceResponse` the request response data model
*/
-(NSDictionary*) createNamespaceSyncWithRequest:(StreamcomputerCreateNamespaceRequest*) createNamespaceRequest
{
StreamcomputerCreateNamespaceExecutor* excutor = [[StreamcomputerCreateNamespaceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createNamespaceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerCreateNamespaceResponse* response = [[StreamcomputerCreateNamespaceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createNamespaceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createNamespaceAsyncWithRequest:(StreamcomputerCreateNamespaceRequest*) createNamespaceRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerCreateNamespaceResponse* _Nullable createNamespaceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerCreateNamespaceExecutor* excutor = [[StreamcomputerCreateNamespaceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createNamespaceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerCreateNamespaceResponse* response = [[StreamcomputerCreateNamespaceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
getStorageList sync request
@param getStorageListRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `getStorageListResponse` the request response data model
*/
-(NSDictionary*) getStorageListSyncWithRequest:(StreamcomputerGetStorageListRequest*) getStorageListRequest
{
StreamcomputerGetStorageListExecutor* excutor = [[StreamcomputerGetStorageListExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:getStorageListRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerGetStorageListResponse* response = [[StreamcomputerGetStorageListResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"getStorageListResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)getStorageListAsyncWithRequest:(StreamcomputerGetStorageListRequest*) getStorageListRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerGetStorageListResponse* _Nullable getStorageListResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerGetStorageListExecutor* excutor = [[StreamcomputerGetStorageListExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:getStorageListRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerGetStorageListResponse* response = [[StreamcomputerGetStorageListResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
updateNamespace sync request
@param updateNamespaceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `updateNamespaceResponse` the request response data model
*/
-(NSDictionary*) updateNamespaceSyncWithRequest:(StreamcomputerUpdateNamespaceRequest*) updateNamespaceRequest
{
StreamcomputerUpdateNamespaceExecutor* excutor = [[StreamcomputerUpdateNamespaceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:updateNamespaceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerUpdateNamespaceResponse* response = [[StreamcomputerUpdateNamespaceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"updateNamespaceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)updateNamespaceAsyncWithRequest:(StreamcomputerUpdateNamespaceRequest*) updateNamespaceRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerUpdateNamespaceResponse* _Nullable updateNamespaceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerUpdateNamespaceExecutor* excutor = [[StreamcomputerUpdateNamespaceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:updateNamespaceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerUpdateNamespaceResponse* response = [[StreamcomputerUpdateNamespaceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteStorage sync request
@param deleteStorageRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteStorageResponse` the request response data model
*/
-(NSDictionary*) deleteStorageSyncWithRequest:(StreamcomputerDeleteStorageRequest*) deleteStorageRequest
{
StreamcomputerDeleteStorageExecutor* excutor = [[StreamcomputerDeleteStorageExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteStorageRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerDeleteStorageResponse* response = [[StreamcomputerDeleteStorageResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteStorageResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteStorageAsyncWithRequest:(StreamcomputerDeleteStorageRequest*) deleteStorageRequest
                       completionHandler:(void(^)(int statusCode,StreamcomputerDeleteStorageResponse* _Nullable deleteStorageResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
StreamcomputerDeleteStorageExecutor* excutor = [[StreamcomputerDeleteStorageExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteStorageRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    StreamcomputerDeleteStorageResponse* response = [[StreamcomputerDeleteStorageResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}


 /**
 streamcomputer common sync request
 @param  jdcloudDataRequest request param
 @return key `statusCode` http request status code type is int
             `dataResult` the http request response data  type is NSData
             `requestError` the request error type is NSError
 */
 -(NSDictionary*) streamcomputerCommonSyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                                   url:(NSString*) url
                                                method:(NSString*) method{
    CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    NSDictionary* responseResult = [excutor executeDataSync:jdcloudDataRequest];
    return responseResult;
}

-(void)streamcomputerCommonAsyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                         url:(NSString*) url
                                      method:(NSString*) method
                           completionHandler:(void(^)(int statusCode, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
     CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    
    [excutor executeDataAsync:jdcloudDataRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        completionHandler(statusCode,responseData,error);
    }];
} 

@end
